<template>
  <div id="app">
   <ul class="jing">
    <li v-for="(item,index) in arr" :key="index" v-on:click="tap(item.id)">{{item.name}}</li>
   </ul>
<HomeView v-show="iid==1"></HomeView>
 <MyvueCom/>
  </div>
</template>
<script>
import HomeView from '@/views/HomeView.vue'
// import MyvueCom from '@/components/MyvueCom.vue'
export default{
  // name:'MyvueCom',
  components:{
    HomeView 
    // MyvueCom
  },
  data(){
    return{
      iid:1,
      arr:[{
        id:1,
        name:'京东'
      },{
        id:2,
        name:'我的京东'
      },{
        id:3,
        name:'购物车'
      },]
      }
},
methods:{
  tap(id){
    this.iid=id
    console.log(id);
    
  }
}
}
</script>
<style>
.jing{
  list-style: none;
  display: flex;
}
.jing li{
  text-align: center;
  line-height: 50px;
  /* width: 50px; */
  height: 50px;
  margin: 10px;
  padding: 10px;
  background-color: aqua;

}
</style>
